// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// import 'res/listData.dart';

// void main() {
//   runApp(MyApp());
// }

// class MyApp extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//       home: Scaffold(
//         appBar: AppBar(
//           title: Text("图片"),
//         ),
//         body: HomeContent(),
//       ),
//     );
//   }
// }

// class HomeContent extends StatelessWidget {
//   List<Widget> list = [];

//   List<Widget> _getData() {
//     // for (int i = 0; i < 200; i++) {
//     //   list.add(ListTile(
//     //     title: Text("我是第$i个栏目"),
//     //   ));
//     // }

//     var tempList = listData.map((e) {
//       return ListTile(
//         leading: Image.network(e["imageUrl"]),
//         title: Text(e["title"]),
//         subtitle: Text(e["author"]),
//       );
//     });
//     return tempList.toList();
//   }

//   @override
//   Widget build(BuildContext context) {
//     return ListView(
//       children: this._getData(),
//     );
//   }
// }

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

//自定义组件
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Demo'),
        ),
        body: HomeContent(),
      ),
      theme: ThemeData(primarySwatch: Colors.yellow),
    );
  }
}

//
class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
        child: Container(
      child: Text(
        '你好Flutter你好Flutter你好Flutter你好Flutter你好Flutter你好Flutter',
        textAlign: TextAlign.right,
        overflow: TextOverflow.ellipsis,
        maxLines: 1,
        textScaleFactor: 2,
        textDirection: TextDirection.ltr,
        style: TextStyle(
          fontSize: 20.0,
          color: Colors.black,
          // color: Color.fromRGBO(244, 233, 121, 0.5),
          decoration: TextDecoration.lineThrough,
          decorationColor: Colors.white,
          decorationStyle: TextDecorationStyle.dashed,
          letterSpacing: 5.0,
        ),
      ),
      height: 300.0,
      width: 300.0,
      decoration: BoxDecoration(
          color: Colors.red,
          border: Border.all(
            color: Colors.blue,
            width: 2.0,
          ),
          borderRadius: BorderRadius.all(
            Radius.circular(20),
          )),
      padding: EdgeInsets.fromLTRB(20, 100, 20, 10),
      // transform: Matrix4.translationValues(100, 0, 0),
      // transform: Matrix4.rotationZ(0.3),

      // transform: Matrix4.diagonal3Values(1.2, 1, 1),
      alignment: Alignment.bottomRight,
    ));
  }
}
